package com.spacing.app;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;

import com.actionbarsherlock.app.ActionBar;
import com.actionbarsherlock.app.SherlockActivity;
import com.google.analytics.tracking.android.EasyTracker;
import com.google.analytics.tracking.android.Tracker;
import com.senseilearning.anatomy.R;
import com.spacing.app.data.Section;

public class SectionViewActivity extends SherlockActivity {
	Section section;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.games);
		Intent index = getIntent();
		section = (Section) index.getSerializableExtra("section");
		
		ActionBar ab = getSupportActionBar();
		ab.setTitle(section.getName());
	}
	
	//onStart and onStop are now only used for calling the analytics methods
	@Override
	public void onStart(){
		super.onStart();
		//New code for this method must be added before the easytracker line!
		EasyTracker.getInstance().activityStart(this);
		Tracker tracker = EasyTracker.getTracker();
		tracker.setCustomDimension(2, section.getName()); //misschien ook een chapter meegeven? dimension id voor een chapter is 1, voor een section 2.
		tracker.sendView();
		
	}
	
	@Override
	public void onStop() {
		super.onStop();
		//New code for this method must be added before the easytracker line!
		EasyTracker.getInstance().activityStop(this);
	}

	public void clickWordlist(View view) {
		Intent intent = new Intent(this, WordsViewActivity.class);
		intent.putExtra("section", section);
		startActivity(intent);

	}

	public void clickMultipleChoice(View view) {
		Intent intent = new Intent(this, DisplayMultipleChoiceActivity.class);
		intent.putExtra("section", section);
		startActivity(intent);
	}

	public void clickHangman(View view) {
		Intent intent = new Intent(this, HangmanActivity.class);
		intent.putExtra("section", section);
		startActivity(intent);
	}

	public void clickTypeIt(View view) {
		Intent intent = new Intent(this, TypeItActivity.class);
		intent.putExtra("section", section);
		startActivity(intent);
	}

	public void clickSpeech(View view) {
		Intent intent = new Intent(this, SpeechActivity.class);
		intent.putExtra("section", section);
		startActivity(intent);
	}
	
	
/*	public void clickQuiz(View view) {
		Intent intent = new Intent(this, QuizActivity.class);
		intent.putExtra("section", section);
		startActivity(intent);
	}*/

}
